// import { createPost } from "@/utils/request";
import type { PagingParames, PagingResponse } from "../index.d";
import type { UserItem } from "./index.d";
// const path = "/api/User/SendCommand";

const moudleType = 'UserForm';
import { createCommand } from '../../commandHelper';

/**
 * @description: 获取用户列表
 */
export const getUsersByCondition = createCommand<PagingParames, PagingResponse<UserItem[]>>(moudleType, { commandName: "GetUsersByCondition" });

/**
 * @description: 通过账户获取用户信息
 */
export const getUserInfoByAccount = createCommand<{ account: string }, any>(moudleType, { commandName: "GetUserInfoByAccount" });

/**
 * @description: 添加用户
 */
export const addUser = createCommand<{ user: UserItem }, never>(moudleType, { commandName: "AddUser" });

/**
 * @description: 修改用户
 */
export const updateUser = createCommand<{ user: UserItem }, never>(moudleType, { commandName: "UpdateUser" });

/**
 * @description: 删除用户
 */
export const deleteUser = createCommand<{ userId: string }, never>(moudleType, { commandName: "DeleteUser" });

/**
 * @description: 获取所有角色类型
 */
export const getRoles = createCommand<{}, string[]>(moudleType, { commandName: "GetRoles" });

/**
 * @description: 获取接口参数说明
 */
export const getMethodDescription = createCommand<never, string>("/api/User/GetMethodDescription");
